<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-用户登录状态显示</title>
</head>
<body>
    <div id="app">
        <button @click="isLogin = !isLogin">切换登录状态</button>
        <div id="showUser" v-show="user">
            {{isLogin ? '欢迎，' + user.name + '，年龄：' + user.age : '请登录'}}
        </div>
    </div>
</body>
<script src="/day1/js/vue.js"> </script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            isLogin: false,
            user:{
                name: '张三',
                age: 18
            }
        }
    });
</script>
</html>